@extends('layouts.fz')
@section('css')
    <link href="{{asset('assets/css/bootstrap.css')}}" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="{{asset('assets/css/font-awesome.css')}}" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="{{asset('assets/css/custom-styles.css')}}" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <link href="{{asset('assets/js/dataTables/dataTables.bootstrap.css')}}" rel="stylesheet" />
@endsection

@section('head')
    <h3 class="page-header">

    </h3>
    <ol class="breadcrumb">
        <li><a href="{{url('home')}}">主页</a></li>
        <li><a href="#">领用录入</a></li>
        <li class="active">已录入列表</li>
    </ol>
@endsection
@section('contain')


    <div class="row">
        <div class="col-md-12">
            <!-- Advanced Tables -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    已审核列表
                    <button type="submit" style="float: right" class="btn btn-primary" onclick="method('dataTables-example')"><i class="fa fa-cloud-download"></i> 导出数据</button>
                </div>
                <div class="panel-body">
                    <div class="">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>名称</th>
                                <th>类型</th>
                                <th>价格</th>
                                <th>数量</th>
                                <th>领用部门</th>
                                <th>录入人名称</th>
                                <th>说明</th>
                                <th>处理状态</th>
                                <th>拒绝原因</th>
                                <th>录入时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($order as $arr)
                                <tr class="odd gradeX">
                                    <td>{{$arr->id}}</td>
                                    <td>{{\App\Product::getName($arr->product_id)}}</td>
                                    <td>{{\App\Product::getType($arr->product_id)}}</td>
                                    <td>{{\App\Product::getPrice($arr->product_id)}}</td>
                                    <td>{{$arr->number}}</td>
                                    <td>{{\App\Department::getDepartmentById($arr->department)}}</td>
                                    <td>{{\App\User::getNameById($arr->user_id)}}</td>
                                    <td>{{$arr->explain}}</td>
                                    <td>{{\App\Order::getState($arr->state)}}</td>
                                    <td>{{$arr->rejected}}</td>
                                    <td>{{$arr->created_at}}</td>
                                    <td class="center">

                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
            <!--End Advanced Tables -->
        </div>
    </div>
@endsection
@section('js')
    <script src="{{asset('assets/js/jquery-1.10.2.js')}}"></script>
    <!-- Bootstrap Js -->
    <script src="{{asset('assets/js/bootstrap.min.js')}}"></script>
    <!-- Metis Menu Js -->
    <script src="{{asset('assets/js/jquery.metisMenu.js')}}"></script>
    <!-- Custom Js -->
    <script src="{{asset('assets/js/dataTables/jquery.dataTables.js')}}"></script>
    <script src="{{asset('assets/js/dataTables/dataTables.bootstrap.js')}}"></script>
    <script>
        $(document).ready(function () {
            $('#dataTables-example').dataTable({
                "oLanguage": {
                    "sProcessing": "正在获取数据，请稍后...",
                    "sLengthMenu": "显示 _MENU_ 条",
                    "sZeroRecords": "没有您要搜索的内容",
                    "sInfo": "从 _START_ 到  _END_ 条记录 总记录数为 _TOTAL_ 条",
                    "sInfoEmpty": "记录数为0",
                    "sInfoFiltered": "(全部记录数 _MAX_ 条)",
                    "sInfoPostFix": "",
                    "sSearch": "搜索",
                    "sUrl": "",
                    "oPaginate": {
                        "sFirst": "第一页",
                        "sPrevious": "上一页",
                        "sNext": "下一页",
                        "sLast": "最后一页"
                    }
                }
            });
        });

        function product_add(name,id) {

            $('#product_id').val(id);
            $('#product_name').val(name);
            $('#add').modal();


        }
        function close_add() {
            $('#add').modal('hide');
            return true;
        }
        function confirmBox(url) {
            console.log(url);
            $('#confirmBoxOk').attr('href',url);
            $('#confirmBox').modal()
        }

    </script>
    <script src="{{asset('assets/js/custom-scripts.js')}}"></script>

@endsection